package com.prs.crm.service.oa.impl;

import java.io.File;
import java.util.Collection;

import com.prs.crm.context.Attach;
import com.prs.crm.context.Constrains;
import com.prs.crm.context.FileUtil;
import com.prs.crm.dao.oa.ApplyCritiqueDao;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.ApplyCritique;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.oa.ApplyCritiqueService;

public class ApplyCritiqueServiceImpl extends BaseServiceImpl<ApplyCritique,ApplyCritiqueDao> implements ApplyCritiqueService{

	@Override
	public void saveApplyCritique(ApplyCritique applyCritique, File file,
			String fileName) {
		// TODO Auto-generated method stub
		Attach attach = FileUtil.getInstance().saveFile(file, fileName, "", Constrains.UPLOAD_DIC_APPLY);
		if(attach.getSrc() != null) {
			applyCritique.setAttach(attach.getSrc());
		}
		this.getDao().save(applyCritique);
	}

	@Override
	public Collection<ApplyCritique> getValidCritiqueInfoApply(Person person) {
		// TODO Auto-generated method stub
		return this.getDao().getValidCritiqueInfoApply(person);
	}

}
